package info.motteke.swt;

import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.TextLayout;
import org.eclipse.swt.widgets.Composite;

/* package */ class CompositeReplaceEntry extends ReplaceEntry {

    private final Composite composite;

    public CompositeReplaceEntry(TextLayout layout, Point margin, int offset, Composite composite) {
        super(layout, margin, offset);
        this.composite = composite;
    }

    @Override
    protected void draw(GC gc) {
        composite.setLocation(getDrawLocation());
    }

    @Override
    protected void dispose() {
        composite.dispose();
    }
}
